#include <iostream>
#include <sstream>

//日志对象
class Logger {
public:
	//构造
	Logger();	
	//析构
	~Logger();	
	std::stringstream& getSS() { return m_ss; }
private:
	std::stringstream m_ss;
};
Logger::Logger(){
	std::cout << "Logger()" << std::endl;
}
Logger::~Logger(){
	std::cout << m_ss.str() << std::endl;
	std::cout << "~Logger()" << std::endl;
}

#define SLYAR_LOG Logger().getSS()

int main(int argc,char** argv){
	std::cout << "===start===" << std::endl;
	//Logger lg;//用了一个具名对象
	SLYAR_LOG << "hello" << " " << "sylar";//通过logger类的构造函数创建临时对象
	std::cout << "====end====" << std::endl;
	return 0;
}
